﻿using Newtonsoft.Json;
using SmartlForm.DAL;
using SmartlForm.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartlForm.NetJs
{
    public partial class BowContainer
    {
        public Result getGroup()
        {
            var accountId = getAccountId();
            //文章分类统计
            List<GroupList> groupList = ArticleDao.Instance.GetGroupByKeywordType(accountId);
            //总新闻
            var articleCount = ArticleDao.Instance.GetGount(accountId);
            var articleNowCount = ArticleDao.Instance.GetNowGount(accountId);
            var nowSendCount = TaskArticlePlatformDao.Instance.GetNowCount(accountId);
            //总新闻
            var group = GroupDao.Instance.Get(accountId);

            return ResultHelper.Success("",
                JsonConvert.SerializeObject(new Dictionary<string, object>() {
                { "groupList", groupList },
                { "articleCount", articleCount },
                { "group", group },
                { "nowSendCount",nowSendCount},
                { "articleNowCount",articleNowCount}
            }));
        }
    }
}
